<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>hello</title>
</head>
<body>

<div id="kuai">
    <button v-on:click="add">你点我啊加</button>
    <button v-on:click="reduce">你点我啊减</button>

    您当前的年龄是：{{age}}

</div>
<script src="./node_modules/vue/dist/vue.js"></script>
<script>
    var heima = new Vue({
        el: "#kuai",
        data: {
            age: 5
        },
        methods: {
            add() {
                this.age++
            },
            reduce() {
                if (this.age === 0) {
                    this.age = 5;
                } else {
                    this.age--
                }
            }
        }
    });
</script>


</body>
</html>